package com.cdtye.shuoh.util.text;

import com.google.common.base.CaseFormat;

import java.util.HashMap;
import java.util.Map;

public class CaseFormatUtils {
    public static Map<String,Object> lowerCamelToLowerUnderscore(Map<String,Object> map){
        if(map.isEmpty()){
            return null;
        }else{
            Map<String, Object> result = new HashMap<>();
            for (String key : map.keySet()) {
                String lkey = CaseFormat.LOWER_CAMEL.to(CaseFormat.LOWER_UNDERSCORE, key);
                result.put(lkey,map.get(key));
            }
            return result;
        }
    }
}
